<template>
    <div class="recommend">
        <div class="listme">
            <div class="tab">
                <ul class="clearfix">
                    <li class="fl">姓名</li>
                    <li class="fl">手机号</li>
                    <li class="fl">获得日期</li>
                </ul>
            </div>
            <div class="tabs">
                <ul class="clearfix" v-for="list in lists">
                    <li class="fl">{{list.name.replace(/.(?=.)/g,'*')}}</li>
                    <li class="fl">{{list.mobile.replace(/^(\d{3})\d{4}(\d{4})$/,'$1****$2')}}</li>
                    <li class="fl">{{list.strOt.substring(0, 10)}}</li>
                </ul>
            </div>
        </div>
        <div class="tips" v-if="lists.length==0">
            <img src="../../assets/imgs/member/tips-2.png" alt="">
            <p>您暂无推荐记录～</p>
        </div>
    </div>
</template>

<script>
import http from "@/assets/js/axios";
import { domain } from '@/assets/js/config'
import $ from 'jquery'
import { Toast } from 'mint-ui';
export default {
    data() {
        return {
            isAshow: false,
            isBshow: false,
            userToken: '',
            lists: [],
            datys: {
                dateType: 4
            }
        }
    },
    components: {

    },
    mounted() {
        let userToken = localStorage.getItem("token") || ''
        this.userToken = userToken
        if (!this.userToken) {
            this.$router.push('/login')
        }
        this.recommendNow();
    },
    methods: {
        direct: function (val) {
            this.$router.push({ path: '/' + val });
        },
        recommendNow: async function () {
            const res = await http.post('xshk/f/user/reList?token=' + this.userToken)
            // console.log(res);
            if (res.data.code == 0) {
                this.lists = res.data.data.list
            }
        },
    }
}
</script>

<style lang="stylus" scoped>
.recommend {
    .listme {
        div.tab {
            padding: 10px 15px;
            border-bottom: 1px solid rgba(240, 240, 240, 1);

            ul {
                text-align: center;

                li {
                    width: 33.3%;
                    font-size: 14px;
                    font-family: PingFangSC-Regular;
                    font-weight: 400;
                    color: rgba(153, 153, 153, 1);
                }
            }
        }

        div.tabs {
            padding: 10px 15px;

            ul {
                text-align: center;
                margin: 10px 0;

                li {
                    width: 33.3%;
                    font-size: 12px;
                    font-family: PingFangSC-Regular;
                    font-weight: 400;
                    color: rgba(51, 51, 51, 1);
                }
            }
        }
    }

    .tips {
        margin-top: 50px;
        width: 100%;
        text-align: center;
        font-size: 16px;
        font-family: PingFangSC-Regular;
        font-weight: 400;
        color: rgba(221, 221, 221, 1);

        img {
            width: 150px;
            height: 150px;
        }
    }
}
</style>
